﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Quote.cs" company="">
//   
// </copyright>
// <summary>
//   The quote.
// </summary>
// --------------------------------------------------------------------------------------------------------------------


using System;

namespace Systemathics.FrameWork
{
    [Serializable]
    public sealed class Quote : ICloneable
    {
        public Guid Id { get; private set; }
        public int BidSize      { get; set; }
        public Decimal Bid { get; set; }
        public Decimal Ask { get; set; }
        public int AskSize      { get; set; }
        public Decimal Mid
        {
            get { return Math.Round((Bid + Ask)/2, 6); }
        }
        public Decimal? Spread
        {
            get { return Math.Abs(Math.Round(Ask - Bid, 6)); }
        }
        public DateTime Time { get; set; }

        public Quote(Guid id)
        {
            Id = id;
        }
        #region ICloneable Members

        public object Clone()
        {
            return MemberwiseClone();
        }

        #endregion 
    }
}